:art: Not make thumbnail when both width and height lte

huangqimin001 %!s(int64=5) %!d(string=hace) meses
padre
commit
0a9524c13c
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      utils/thumbnail_utils.py

+ 2 - 0
utils/thumbnail_utils.py

@@ -32,6 +32,8 @@ def make_thumbnail2(data, w=360, h=240):
32 32
     im = Image.open(BytesIO(data))
33 33
     fmt = im.format.lower()
34 34
     width, height = im.size
35
+    if width <= w and height <= h:
36
+        return data
35 37
     if width > height:
36 38
         thumb_width, thumb_height = w, height * w / width
37 39
     else: